function GetTestBase() {

	
	var myData = [
			['1', "启用", 'telnet基线', 'telnet基线描述','放行','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['2', "启用", 'ftp基线', 'ftp基线描述','拦截','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['3', "启用", 'telnet基线', 'telnet基线描述','放行','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['4', "启用", 'sftp基线', 'sftp基线描述','放行','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['5', "启用", 'http基线', 'http基线描述','拦截','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2']
	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'status'
						}, {
							name : 'name'
						}, {
							name : 'desc'
						}, {
							name : 'action'
						}, {
							name : 'context'
						}, {
							name : 'createtime'
						}, {
							name : 'creator'
						}, {
							name : 'modifytime'
						}, {
							name : 'modifier'
						}]
			});
			



	store.loadData(myData);
	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '状态',
							width : 100,
							sortable : true,
							dataIndex : 'status'
						}, {
							header : '名称',
							width : 100,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 150,
							sortable : true,
							dataIndex : 'desc'
						}, {
							header : '动作',
							width : 70,
							sortable : true,
							dataIndex : 'action'
						}, {
							header : '明细',
							width : 100,
							sortable : true,
							dataIndex : 'context'
						}, {
							header : '创建时间',
							width : 150,
							sortable : true,
							dataIndex : 'createtime'
						}, {
							header : '创建者',
							width : 100,
							sortable : true,
							dataIndex : 'creator'
						}, {
							header : '修改时间',
							width : 150,
							sortable : true,
							dataIndex : 'modifytime'
						}, {
							header : '修改者',
							width : 100,
							sortable : true,
							dataIndex : 'modifier'
						}],
				sm : sm,
				tbar : ['选择设备:',{xtype: 'textfield',width : 300},{
							text : '选择',
							tooltip : '选择',
							handler : function() {
								GetLinkDevice();
							}
						},'-',{
							text : '开始检测',
							tooltip : '开始检测',
							handler : function() {
								SetTestBase();
							}
						}],
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'testbasegrid'
			});



	
	
	return grid;
}	

function SetTestBase(setReturn){
	var myData = [
			['1', '1', '设备1','inside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>All-Inside-Subnets","<img src='../images/terminal.png'>Corp-Mail-Server","<img src='../images/tcp.png'>Mail_Services","<img src='../images/tick.png'>Permit","","Alerts","","Allow individual hosts to vpn to partner services",'2,3','冲突'],
			['2', '2', '设备1','inside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>FTP_Servers_inside<br><img src='../images/terminallist.png'>Web_Servers_group","<img src='../images/terminal.png'>10.0.101.0/24<br><img src='../images/terminal.png'>10.0.102.0/24<br><img src='../images/terminal.png'>10.0.100.0/24<br><img src='../images/terminal.png'>10.0.103.0/24<br><img src='../images/terminal.png'>10.0.104.0/24","<img src='../images/tcp.png'>ftp<br><img src='../images/tcp.png'>http<br><img src='../images/tcp.png'>https<br><img src='../images/tcp.png'>ssh","<img src='../images/delete.png'>Deny","","Critical","","",'1,3','冲突'],
			['3', '3', '设备1','inside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>inside-network/24","<img src='../images/terminal.png'>10.1.100.0/24","<img src='../images/tcp.png'>ftp","<img src='../images/tick.png'>Permit","","Warnings","","",'2,1','冲突'],
			['4', '1', '设备2','outside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>WWW_Server","<img src='../images/tcp.png'>http","<img src='../images/tick.png'>Permit","","Warnings","","",'3','冲突'],
			['5', '2', '设备2','outside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>DMZ-network","<img src='../images/tcp.png'>http","<img src='../images/tick.png'>Permit","","Warnings","","",'1','冲突'],
			['6', '3', '设备2','outside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>outside-network/24","<img src='../images/terminal.png'>Ftp_Server","<img src='../images/tcp.png'>ftp","<img src='../images/tick.png'>Permit","","Warnings","","",'2','冲突'],
			['7', '1', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>Remote-net-groups","<img src='../images/terminal.png'>Web_Server_group","<img src='../images/tcp.png'>HTTP-services","<img src='../images/tick.png'>Permit","","Warnings","","",'2,3','冲突'],
			['8', '2', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>10.1.100.0/24","<img src='../images/terminal.png'>FTP_Server_group","<img src='../images/tcp.png'>ftp","<img src='../images/delete.png'>Deny","","Warnings","","",'1,3','冲突'],
			['9', '3', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>partner-dmz-network","<img src='../images/terminal.png'>Web_Server_group","<img src='../images/tcp.png'>ip","<img src='../images/tick.png'>Permit","","Warnings","","",'1,2','冲突'],
			['10', '1','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>Cisco","<img src='../images/tcp.png'>HTTP-services","<img src='../images/tick.png'>Permit","","Warnings","","",'3','冲突'],
			['11', '2','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>Youtube","<img src='../images/tcp.png'>HTTP-services","<img src='../images/delete.png'>Deny","","Warnings","","Marketing, and one of the sales people need access to Youtube for posting product videos",'3','冲突'],
			['12', '3','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>Facebook","<img src='../images/tcp.png'>HTTP-services","<img src='../images/tick.png'>Permit","","Warnings","","Allow only employees to visit Facebook",'2','冲突']
	];



		
   // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       			{
							name : 'id'
						}, {
							name : 'index'
						}, {
							name : 'devices'
						}, {
							name : 'type'
						}, {
							name : 'Enabled'
						}, {
							name : 'Source'
						}, {
							name : 'Destination'
						}, {
							name : 'Service'
						}, {
							name : 'Action'
						}, {
							name : 'Hits'
						}, {
							name : 'Logging'
						}, {
							name : 'Time'
						}, {
							name : 'Description'
						}, {
							name : 'relational'
						}, {
							name : 'status'
						}
    ]);

    var store = new Ext.data.GroupingStore({
            reader: reader,
            data: myData,
            sortInfo:{field: 'id', direction: "ASC"},
            groupField:'devices'
        });



	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [{
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '#',
							width : 10,
							sortable : true,
							dataIndex : 'index'
						}, {
							header : '设备',
							width : 70,
							sortable : true,
							dataIndex : 'devices'
						}, {
							header : 'interface',
							width : 70,
							sortable : true,
							dataIndex : 'type'
						}, {
							header : 'Source',
							width : 70,
							sortable : true,
							dataIndex : 'Source'
						}, {
							header : 'Destination',
							width : 100,
							sortable : true,
							dataIndex : 'Destination'
						}, {
							header : 'Service',
							width : 70,
							sortable : true,
							dataIndex : 'Service'
						}, {
							header : 'Action',
							width : 30,
							sortable : true,
							dataIndex : 'Action'
						}, {
							header : 'Hits',
							width : 30,
							sortable : true,
							dataIndex : 'Hits'
						}, {
							header : 'Logging',
							width : 50,
							sortable : true,
							dataIndex : 'Logging'
						}, {
							header : 'Time',
							width : 50,
							sortable : true,
							dataIndex : 'Time'
						}, {
							header : 'Description',
							width : 70,
							sortable : true,
							dataIndex : 'Description'
						}, {
							header : '相关项',
							width : 70,
							sortable : true,
							dataIndex : 'relational'
						}, {
							header : '状态',
							width : 70,
							sortable : true,
							dataIndex : 'status'
						}],
				sm : sm,
				view: new Ext.grid.GroupingView({
		            forceFit:true,
		            startCollapsed : false ,
		            groupTextTpl: '{gvalue}'
		        }),
				
				
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				region : 'center',
				stateId : 'testgrid'
			});
	var myData_1 = [
			['1','telnet基线','设备1','内容描述','策略1','冲突'],
			['2','ftp基线','设备2','内容描述','策略2','冲突'],
			['3','Sftp基线','设备3','内容描述','策略3','冲突'],
			['4','http基线','设备4','内容描述','策略4','冲突'],
			['5','https基线','设备5','内容描述','策略5','冲突'],
			['6','https基线','设备6','内容描述','策略6','冲突'],
			['7','telnet基线','设备7','内容描述','策略7','冲突'],
			['8','Sftp基线','设备8','内容描述','策略8','冲突'],
			['9','ftp基线','设备9','内容描述','策略9','冲突'],
			['10','telnet基线','设备10','内容描述','策略10','冲突']

	];


	var store_1 = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'device'
						}, {
							name : 'context'
						}, {
							name : 'policy'
						}, {
							name : 'result'
						}]
			});
			
	store_1.loadData(myData_1);
	
	var sm_1 = new Ext.grid.CheckboxSelectionModel();

 	var store1 = new Ext.data.JsonStore({
        fields: [{name: 'check'},{name: 'x'},{name: 'y',type: 'int'}],
        data: [
        {check: '设备1',x: 5,y: 3},
        {check: '设备2',x: 3,y: 5},
        {check: '设备3',x: 4,y: 6},
        {check: '设备4',x: 5,y: 7},
        {check: '设备5',x: 6,y: 5}
        ]
    });
	var chat1={
						    xtype: 'stackedcolumnchart',
						    store: store1,
						    xField: 'check',
						    xAxis: new Ext.chart.CategoryAxis({
						        title: '设备'
						    }),
						    yAxis: new Ext.chart.NumericAxis({
						        title: "数量"
						    }),
						    series: [{
						        displayName: "满足数量",
						        yField: 'x'
						    },{
						        displayName: "不满足数量",
						        yField: 'y'
						    }],
						    chartStyle: {
						        padding: 10,
						        legend: {
						            display: 'right'
						        }
						    }
							};		
 	var store2 = new Ext.data.JsonStore({
        fields: [{name: 'check'},{name: 'x'},{name: 'y',type: 'int'}],
        data: [
        {check: 'telnet基线',x: 6,y: 4},
        {check: 'ftp基线   ',x: 4,y: 6},
        {check: 'sftp基线  ',x: 5,y: 5},
        {check: 'http基线  ',x: 2,y: 3},
        {check: 'https基线 ',x: 7,y: 2}
        ]
    });
	var chat2={
						    xtype: 'stackedcolumnchart',
						    store: store2,
						    xField: 'check',
						    xAxis: new Ext.chart.CategoryAxis({
						        title: '基线名称'
						    }),
						    yAxis: new Ext.chart.NumericAxis({
						        title: "数量"
						    }),
						    series: [{
						        displayName: "满足数量",
						        yField: 'x'
						    },{
						        displayName: "不满足数量",
						        yField: 'y'
						    }],
						    chartStyle: {
						        padding: 10,
						        legend: {
						            display: 'right'
						        }
						    }
							};		
	var states = [
		['1', '设备'],
		['2', '基线top10']
		];
	var northPanel = new Ext.Panel(	{
							region: 'north',
							height: 300,
							name : 'chat1',
							items : [chat1]
						});
	var gridPanel = new Ext.Panel({
							region: 'center',
							layout : 'fit',
							title:'明细表格',
							items : [grid]
						});
	var centerPanel = new Ext.Panel({
        
        region : 'center',
        layout : 'border',
        tbar : [ {
															xtype : 'combo',
															name : 'chatterm',
															frame : true,
															id : 'chatterm',
															store : new Ext.data.ArrayStore({
																	fields : ['abbr', 'state'],
																	data : states
																}),
															valueField : 'abbr',
															displayField : 'state',
															typeAhead : true,
															mode : 'local',
															triggerAction : 'all',
															value : '1',
															editable : false,
															width : 140,
															listeners : {
													        select : function (combo, record, index) {
													        	var items=northPanel.items.items;
																			for(var i=0;i<items.length;i++){
																			  	northPanel.remove(items[i]);
																		}
													        	if(record.get('abbr') == '1'){
													        		northPanel.add(chat1);
													        	}else if(record.get('abbr') == '2'){
																			northPanel.add(chat2);
													        	}
																		
																		northPanel.doLayout();

													        	var items=gridPanel.items.items;
																			for(var i=0;i<items.length;i++){
																			  	gridPanel.remove(items[i]);
																		}
													        	if(record.get('abbr') == '1'){
													        			
																			var grid = new Ext.grid.GridPanel({
																										store : store,
																										columns : [{
																													id : 'id',
																													header : 'id',
																													width : 10,
																													sortable : true,
																													dataIndex : 'id',
																													hidden : true
																												}, {
																													header : '#',
																													width : 10,
																													sortable : true,
																													dataIndex : 'index'
																												}, {
																													header : '设备',
																													width : 70,
																													sortable : true,
																													dataIndex : 'devices'
																												}, {
																													header : 'interface',
																													width : 70,
																													sortable : true,
																													dataIndex : 'type'
																												}, {
																													header : 'Source',
																													width : 70,
																													sortable : true,
																													dataIndex : 'Source'
																												}, {
																													header : 'Destination',
																													width : 100,
																													sortable : true,
																													dataIndex : 'Destination'
																												}, {
																													header : 'Service',
																													width : 70,
																													sortable : true,
																													dataIndex : 'Service'
																												}, {
																													header : 'Action',
																													width : 30,
																													sortable : true,
																													dataIndex : 'Action'
																												}, {
																													header : 'Hits',
																													width : 30,
																													sortable : true,
																													dataIndex : 'Hits'
																												}, {
																													header : 'Logging',
																													width : 50,
																													sortable : true,
																													dataIndex : 'Logging'
																												}, {
																													header : 'Time',
																													width : 50,
																													sortable : true,
																													dataIndex : 'Time'
																												}, {
																													header : 'Description',
																													width : 70,
																													sortable : true,
																													dataIndex : 'Description'
																												}, {
																													header : '相关项',
																													width : 70,
																													sortable : true,
																													dataIndex : 'relational'
																												}, {
																													header : '状态',
																													width : 70,
																													sortable : true,
																													dataIndex : 'status'
																												}],
																										sm : sm,
																										view: new Ext.grid.GroupingView({
																								            forceFit:true,
																								            startCollapsed : false ,
																								            groupTextTpl: '{gvalue}'
																								        }),
																										
																										
																										stripeRows : true,
																										autoExpandColumn : 'id',
																										stateful : true,
																										region : 'center',
																										stateId : 'testgrid'
																									});					
													        		gridPanel.add(grid);
													        	}else if(record.get('abbr') == '2'){
													        		var grid_1 = new Ext.grid.GridPanel({
																											store : store_1,
																											columns : [sm_1, {
																														id : 'id',
																														header : 'id',
																														width : 10,
																														sortable : true,
																														dataIndex : 'id',
																														hidden : true
																													}, {
																														header : '名称',
																														width : 100,
																														sortable : true,
																														dataIndex : 'name'
																													}, {
																														header : '设备',
																														width : 100,
																														sortable : true,
																														dataIndex : 'device'
																													}, {
																														header : '基线内容',
																														width : 100,
																														sortable : true,
																														dataIndex : 'context'
																													}, {
																														header : '策略',
																														width : 100,
																														sortable : true,
																														dataIndex : 'policy'
																													}, {
																														header : '结果',
																														width : 100,
																														sortable : true,
																														dataIndex : 'result'
																													}],
																											sm : sm_1,
																											
																											stripeRows : true,
																											autoExpandColumn : 'id',
																											stateful : true,
																											stateId : 'vpncountgrid_1'
																										});
													        			
																			gridPanel.add(grid_1);
													        	}
																		
																		gridPanel.doLayout();

													   			}
													   	}
								},'-',{
							text : '导出',
							tooltip : '导出',
							iconCls : 'out',
							handler : function() {							
							}
						}],
        items: [
        		northPanel,gridPanel
        ]

			});
    
    
	
	var setWindows = new Ext.Window({
				layout : 'border',
				width: 900,
        height: 650,
				title : "业务安全基线检测",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'hazard',
				items : [centerPanel],
				plain : true
				
			});
	
	setWindows.show();
}